<template>
  <div>
    <h2 class="mat-2">父组件</h2>
    <p class="mat-2">接收到父组件的数据 ~ {{ name }}</p>
    <p class="mat-2">$attrs ~ {{ $attrs }}</p>
    <grand-children
      v-bind="{ ...this.$attrs, ...this.$data }"
      :parentName="parentName"
      v-on="$listeners"
    ></grand-children>
  </div>
</template>
<script>
import GrandChildren from './GrandChildren'
export default {
  inheritAttrs: false,
  components: { GrandChildren },
  props: {
    name: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
      parentName: '名称：父亲',
      parentAge: '父亲年龄：70'
    }
  }
}
</script>
